<?php
/////////////////////////////////////////////////////////////////////////////
// 这个文件是 网城创想多用户商城 项目的一部分
//
// Copyright (c) 2007 - 2008 www.shopnc.net 
//
// 要查看完整的版权信息和许可信息，请查看源代码中附带的 COPYRIGHT 文件，
// 或者访问 http://www.shopnc.net/ 获得详细信息。
/////////////////////////////////////////////////////////////////////////////

/**
 * FILE_NAME : own_main.php   FILE_PATH : D:\webroot\mulitishop\member\own_main.php
 * ....书写本页代码的说明
 *
 * @copyright Copyright (c) 2007 - 2007 www.shopnc.net 
 * @author 网城创想多用户商城开发团队 php_netproject@yahoo.com.cn
 * @package 
 * @subpackage 
 * @version Wed Sep 12 15:49:19 CST 2007
 */

require ("../global.inc.php");

class OwnMain extends CommonFrameWork{
	/**
	 * 会员对象
	 *
	 * @var obj
	 */
	var $obj_member;
	/**
	 * 商品订单对象
	 *
	 * @var obj
	 */
	var $obj_product_order;
	/**
	 * 商品对象
	 *
	 * @var obj
	 */
	var $obj_product;
	
	function main(){
		/**
		 * 创建会员对象
		 */
		if (!is_object($this->objmember)){
			require_once ("member.class.php");
			$this->obj_member = new MemberClass();
		}
		/**
		 * 创建商品订单对象
		 */
		if (!is_object($this->obj_product_order)){
			require_once("order.class.php");
			$this->obj_product_order = new ProductOrderClass();
		}
		/**
		 * 创建商品对象
		 */
		if (!is_object($this->obj_product)){
			require_once("product.class.php");
			$this->obj_product = new ProductClass();
		}
		
		/**
		 * 设置模板路径
		 */
		$this->setsubtemplates("member");
		/**
		 * 语言包
		 */
		//$this->getlang("member");
		$this->memberMenuModule();
		
		/*得到会员资料*/
		$condition['id'] = $_SESSION['s_login']['id'];
		$member_array = $this->obj_member->getMemberInfo($condition,'*',$operate_genre='more');
		
		/*买家提醒区*/
		$obj_condition[state] = array("0","1","2","3");
		$obj_condition[member_id] = $_SESSION['s_login']['id'];
		$obj_condition[order_case] = 'bought';
		$obj_condition[time] = '2';
		$buyer_array = $this->obj_product_order->getProductOrderList($obj_condition, $obj_page);
		$buyer_remind = count($buyer_array);/*最近1个月购买的宝贝*/
		
		$obj_condition = "";
		$obj_condition[state] = array("3");
		$obj_condition[member_id] = $_SESSION['s_login']['id'];
		$obj_condition[order_case] = 'bought';
		$obj_condition[comment] = 5;
		$comment_array = $this->obj_product_order->getProductOrderList($obj_condition, $obj_page);
		$buyer_have_comment = count($comment_array);/*最近1个月购买的宝贝*/
		
		/**
		 * 更新商品数量，橱窗推荐数
		 */
		$this->obj_product->updateProductStatistics($_SESSION['s_login']['id'], 'recommend');
		/**
		 * 页面输出
		 */
		$this->output('member_array',$member_array);
		$this->output("member_info", $_SESSION['s_login']);
		$this->output('buyer_remind',$buyer_remind);
		$this->output('buyer_have_comment',$buyer_have_comment);
		$this->showpage("own_main");
	}
}
$o_main = new OwnMain();
$o_main->main();
unset($o_main);
?>